/**
 *  Copyright 2012 Antoine RADET
 *
 *   This file is part of Film Collection.
 *
 *   Film Collection is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   Film Collection is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with Film Collection.  If not, see <http://www.gnu.org/licenses/>.
*/

/**
 * \file display.h
 * \brief Functions and constants declaration for display management
 * \author Antoine RADET
 */

#ifndef DISPLAY_H
#define DISPLAY_H

#include <stdint.h>
#include <gtk/gtk.h>

#include "../Source_Files/movie.h"

/**
 * \def WIDTH
 * \brief Main window's width
 */
#define WIDTH 800

/**
 * \def HEIGHT
 * \brief Main window's height
 */
#define HEIGHT 600

/**
 * \def NBR_ITEMS_FILE
 * \brief Number of items in the "file" menu
 */
#define NBR_ITEMS_FILE 4

enum {  NEW, OPEN, SAVE, QUIT};

/**
 * \def NBR_ITEMS_MODE
 * \brief Number of items in the "mode" menu
 */
#define NBR_ITEMS_MODE 2

enum {  VIEW, EDIT };

/**
 * \def NBR_ITEMS_HELP
 * \brief Number of items in the "help" menu
 */
#define NBR_ITEMS_HELP 2

enum { HELP, ABOUT};

/**
 * \struct movieInfo
 * \brief Contains each field for the left information box
 */
typedef struct{
    GtkWidget *fieldList[SYNOPSIS];   /*!< Information fields (Box : text + GtkEntry) */
    GtkWidget *infoTitle[SYNOPSIS];   /*!< Title of each field */
    GtkWidget *infoText[SYNOPSIS];    /*!< Movie's information */
}MovieInfo;

typedef struct{
    GtkWidget * mainWindow;    /* Main window */

    /** Boxes **/
    GtkWidget *boxTop;

    GtkWidget *boxInformationLeft;    /* Contains the title, year, director, duration, languages and subtitles language */

    GtkWidget *boxInformationRight;
    GtkWidget *poster;   /* Contains the film poster */

    GtkWidget *synopsis;

    GtkWidget *boxAll;  /* Contains every window elements */
    /** End boxes **/

    GtkWidget *menuBar;    /* Menu bar */

    MovieInfo info; /* Content of the information box */
    char *currentMoviePath;  /* Path for saving the current movie */

    uint8_t mode;   /* Current mode */

    Movie *currentMovie;
}Display;

/* Create a new Display */
Display *display_new();

/* Free the memory allocated to a display */
void display_delete(Display *ptrDisp);

/* Display the main window */
void display_show();

/* Update the information box */
void display_update_information(Movie * ptrFilm, GtkWidget * labelList[], uint8_t mode);


#endif
